package com.cn.rocketmq.controller;

import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(topic = "first-topic",
        selectorType = SelectorType.TAG,
        selectorExpression = "test",
        consumerGroup = "boot-test-consumer",
        consumeMode = ConsumeMode.CONCURRENTLY)
@Component
public class StringConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("收到了消息: " + message);
    }


}
